Add Gentoo handling to network-bridge. Based on patches
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 13:14:04 +0000 (14:14 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 13:14:04 +0000 (14:14 +0100)
from Jon Mason and Anthony Liguori.

tools/examples/network-bridge

index f743aae76eb158112aabdfb60a427b13e3208eb3..f862db0c3f61a49264e8cc21f6e4b64dd407107d 100755 (executable)
@@ -55,6 +55,17 @@ antispoof=${antispoof:-no}
 
 echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
 
+# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
+which ifup >& /dev/null
+if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
+    ifup() {
+        /etc/init.d/net.$1 start
+    }
+    ifdown() {
+        /etc/init.d/net.$1 stop
+    }
+fi
+
 # Usage: transfer_addrs src dst
 # Copy all IP addresses (including aliases) from device $src to device $dst.
 transfer_addrs () {